<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>热力图</title>

    <link rel="stylesheet" href="http://127.0.0.1/arcgis_js_api/library/4.7/esri/css/main.css">
    <link rel="stylesheet" href="css/mainApp.css">



    <script src="../dist/config.js"></script>

    <script src="http://127.0.0.1/arcgis_js_api/library/4.7/init.js"></script>
    <script>


        // Load the Map and MapView modules
        require(["esri/Map",

            "dextra/layers/GoogleVectorLayer",
            "dextra/modules/viewers/MapViewer",
            "dextra/layers/HeatMapLayer",
            "esri/geometry/Point",

            "dojo/domReady!src/heatMapdemo"], function(Map, GoogleVectorLayer, MapViewer, HeatMapLayer, Point) {
            var data = [
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.11,
                            "latitude": 24.84
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.18,
                            "latitude": 24.83,
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.24,
                            "latitude": 24.98
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.26,
                            "latitude": 24.36
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.46,
                            "latitude": 25.49
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.12,
                            "latitude": 24.95
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.15,
                            "latitude": 24.98
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.16,
                            "latitude": 24.91
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.23,
                            "latitude": 24.90
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.23,
                            "latitude": 24.88
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.1,
                            "latitude": 24.93
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.13,
                            "latitude": 24.96
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.27,
                            "latitude": 24.88
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.26,
                            "latitude": 24.87
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.14,
                            "latitude": 25.04
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.12,
                            "latitude": 24.15
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.104,
                            "latitude": 24.98
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.01,
                            "latitude": 24.46
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.18,
                            "latitude": 24.96
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.104,
                            "latitude": 24.23
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.33,
                            "latitude": 24.85
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.17,
                            "latitude": 24.89
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.1,
                            "latitude": 24.87
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.68,
                            "latitude": 24.1
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.01,
                            "latitude": 24.73
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.88,
                            "latitude": 24.25
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.12,
                            "latitude": 24.05
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.17,
                            "latitude": 24.73
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.18,
                            "latitude": 24.69
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.15,
                            "latitude": 24.66
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.098,
                            "latitude": 24.51
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.99,
                            "latitude": 24.57
                        }
                    },
                    {
                        "attributes": {

                        },
                        "geometry": {  spatialReference: {wkid: 102100},
                            "longitude": 103.19,
                            "latitude": 24.69
                        }
                    },

            ];


            var layer=new GoogleVectorLayer();
            var heatmapLayer=new HeatMapLayer({
                config:{
                    radius: 15,
                    opacity:0.5,
                    debug: false,
                    visible: true,
                    gradient: {
                        0.45: "rgb(000,000,255)",
                        0.55: "rgb(000,255,255)",
                        0.65: "rgb(000,255,000)",
                        0.95: "rgb(255,255,000)",
                        1.00: "rgb(255,000,000)"
                    }
                }
            });

            var myMap = new Map({
                //  basemap:"topo",
                layers:[layer,heatmapLayer]
            });


            var mapViewer = new MapViewer({
                map: myMap,
                viewNode: "viewDiv",
            });


            mapViewer.view.when(function(){
                heatmapLayer.setHeatMapData(data);
            });




        });
    </script>


</head>
<body>

<div id="viewDiv"></div>
</body>
</html>